<extend name="Base/base" />
<block name='head'>
    <link rel="stylesheet" type="text/css" href="/Public/Admin/css/main.css"/>
    <style>
        table{
            table-layout: fixed;
        }
        td{
            height: 60px;
            white-space: nowrap;/*控制单行显示*/
            overflow: hidden;/*超出隐藏*/
            text-overflow: ellipsis;/*隐藏的字符用省略号表示*/
        }
        .operate{color: #1781d0;}
    </style>
</block>
<block name="content" >
    <section class="layui-larry-box mian-page page-attendanceStatistics">
        <div class="larry-personal">
            <div class="layui-tab">
                <blockquote class="layui-elem-quote news_search">
                    <form method="get" id='form'>
                        <div class="layui-inline">
                            <span class="btn-upload form-group">
                                <input type="text" name="user_name" placeholder="姓名" value="{$name}" class="layui-input search_input">
                            </span>
                        </div>
                        <div class="layui-inline">
                            <span class="btn-upload form-group">
                                <select name="dept_id" class="layui-select">
                                    <option value="">按部门</option>
                                    <foreach name="depts" item="dept">
                                        <option value="{$dept.dept_id}" {$deptid == $dept['dept_id'] ? 'selected' : ''}>{$dept.dept_name}</option>
                                    </foreach>
                                </select>
                            </span>
                        </div>
                        <!--从第一页开始查询-->
                        <input type="hidden" name="p" value="1">
                        <a class="layui-btn search_btn search" data-url="{:U('address')}" style="margin-left:10px;"> 查询</a>
                    </form>
                </blockquote>
                <div class="layui-tab-content larry-personal-body clearfix mylog-info-box tabRedefine layui-tab-brief">
                    <div class="layui-tab-item layui-field-box layui-show absence">
                        <table class="layui-table setTabBg out" lay-skin="line">
                            <thead>
                                <tr>
                                    <th>姓名</th>
                                    <th>性别</th>
                                    <th>部门</th>
                                    <th>手机号</th>
                                    <th>电子邮箱</th>
                                    <th>排序</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody id="tb">
                            <notempty>
                                <foreach name='address' item='row'>
                                    <tr>
                                        <td>{$row.info.user_name}</td>
                                        <td>{$row['info']['sex'] ? '女' : '男'}</td>
                                        <td>{$row.info.dept_id|getDeptName}</td>
                                        <td>{$row.info.mobil_no}</td>
                                        <td>{$row.info.email}</td>
                                        <td>{$row.address_no}</td>
                                        <td>
                                            <a class="pointer operate editAttach" href="{:U('saveAddress',array('id'=>$row['id']))}">编辑</a>
                                            <a class="pointer delete" data-url='{:U("delAddress",array("id"=>$row["id"]))}'>删除</a>
                                        </td>
                                    <tr>
                                </foreach>
                            </notempty>
                            </tbody>
                        </table>
                    </div>
                    <div class="layui-block">共{$count}条数据</div>
                    <div class="larry-table-page clearfix">
                        <div id="page" class="page">{$page}</div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</block>
<block name="script">
    <script type="text/javascript" src="/Public/Admin/js/common.js"></script>
    <script>
        //查询
        $('.search').click(function () {
            $('form').submit();
        })
    </script>
</block>